﻿<Window x:Class="TapiocaWpf.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:TapiocaWpf.Controls"
        xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
        xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 
        xmlns:cm="clr-namespace:System.ComponentModel;assembly=System" 
        Title="Tapioca" Height="674" Width="924" WindowState="Maximized" 
        Icon="/Resources/tapioca_windows.ico" Loaded="Window_Loaded" Closed="Window_Closed" Background="#FFF9F9F9">    
    <Window.Resources>        
        <ContextMenu x:Key="contextMenu">
            <MenuItem Header="Generate graph" Name="generateGraphMenuItem" Click="generateGraphMenuItem_Click" />
            <MenuItem  Header="View linkbase file" Name="viewlinkbaseFileMenuItem" Click="viewlinkbaseFileMenuItem_Click" />
            <MenuItem Header="Expand All" Name="expandAllMenuItem" Click="expandAllMenuItem_Click" />
        </ContextMenu>
        <ContextMenu x:Key="cmAvalonEdit">
            <MenuItem Header="Save Document" Name="saveDocumentMenuItem" Click="ButtonSave_Click" />
            <MenuItem  Header="Copy to Clippboard" Name="CopyToClipboardMenuItem" Click="CopyToClipboardMenuItem_Click" />
        </ContextMenu>
        <ContextMenu x:Key="cmDTS">
            <MenuItem Header="Copy DTS to clipboard" Name="MenuItemCopyDTS" Click="MenuItemCopyDTS_Click" />
            <MenuItem  Header="Expand All" Name="MenuItemExpandAll" Click="MenuItemExpandAll_Click" />
            <MenuItem Header="Generate graph" Name="MenuItemGenerateGraph" Click="MenuItemGenerateGraph_Click" />
        </ContextMenu>        
    </Window.Resources>
    <Window.InputBindings>
        <KeyBinding Command="ApplicationCommands.SaveAs" Key="S" Modifiers="Control+Alt"></KeyBinding>
       
    </Window.InputBindings>
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Open" Executed="OpenFile" />
        <CommandBinding Command="ApplicationCommands.Save" Executed="ButtonSave_Click" />
        <CommandBinding Command="ApplicationCommands.SaveAs" Executed="SaveAsFile" />
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*" />
            <RowDefinition Height="1*" />
        </Grid.RowDefinitions>
        <DockPanel Grid.Row="0" LastChildFill="True" Width="Auto" Height="Auto">        
            <Menu DockPanel.Dock="Top" IsMainMenu="True">
            <MenuItem Header="_File">
                <MenuItem Header="Open File" Name="openMenuItem" InputGestureText="Ctrl+O" Command="ApplicationCommands.Open"></MenuItem>
                <MenuItem Header="Save" Name="saveMenuItem" InputGestureText="Ctrl+S" Command="ApplicationCommands.Save"></MenuItem>
                <MenuItem Header="Save to File" Name="saveToFileMenuItem" InputGestureText="Ctrl+Alt+S" Command="ApplicationCommands.SaveAs"></MenuItem>
                <MenuItem Header="Close" Name="closeMenuItem" Click="closeMenuItem_Click"></MenuItem>
                <MenuItem Header="Recent Files" Name="recentFilesMenuItem"></MenuItem>
                </MenuItem>
            <MenuItem Header="Tools">
                <MenuItem Header="Proxy Server" Name="proxyServerMenuItem" Click="proxyServerMenuItem_Click"></MenuItem>
                <MenuItem Header="Settings" Name="settingsMenuItem" Click="settingsMenuItem_Click"></MenuItem>
            </MenuItem>
            <MenuItem Header="Rendering" Name="renderingMenuItem" Click="MenuItem_Click" IsEnabled="False">
            </MenuItem>
            <MenuItem Header="Help" Name="helpMenuItem">
            <MenuItem Header="About..." Name="aboutMenuItem" Click="aboutMenuItem_Click"/>
            </MenuItem>
            </Menu>
            <ToolBar DockPanel.Dock="Top">
            <Button Name="ButtonOpen" Height="23" Width="22" Click="ButtonOpen_Click">
                <Image Source="/Resources/toolbarOpenFile.gif"></Image></Button>
            <Button Name="ButtonClose" Height="23" Width="22" Click="ButtonClose_Click" IsEnabled="False">
                <Image Source="/Resources/toolbarClose.gif"></Image>
            </Button>
            <Button Name="ButtonSave" Height="23" Width="22" Click="ButtonSave_Click">
                <Image Source="/Resources/toolbarSaveFile.gif"></Image>
            </Button>
            <Button Name="ButtonValidateDTS" Height="23" Width="22" IsEnabled="False" Click="ButtonValidateDTS_Click">
                <Image Source="/Resources/taxonomy.jpg"></Image>
            </Button>
            <Button Name="ButtonCalculation" Height="23" Width="22" Click="ButtonCalculation_Click" IsEnabled="False">
                <Image Source="/Resources/calculator.png"></Image>
            </Button>
            <Button Name="ButtonFormula" Height="23" Width="22" Click="ButtonFormula_Click" IsEnabled="False">
                <Image Source="/Resources/formula.png"></Image>
            </Button>
            <Button Name="ButtonFind" Height="23" Width="22" Click="ButtonFind_Click" IsEnabled="False">
                <Image Source="/Resources/toolbarFindMenu.gif"></Image>
            </Button>
        </ToolBar>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*" />
                    <ColumnDefinition Width="5*" />
                </Grid.ColumnDefinitions>
                <TabControl Grid.Column="0" Margin="0,0,5,0" Name="tabControlDTS" Width="Auto" Height="Auto" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Background="White">

                </TabControl>
                <TabControl Grid.Column="1" Name="tabControlLinkbases" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" SelectedIndex="1" Background="White"/>
            </Grid>
        </DockPanel>
        <DockPanel Grid.Row="1" Width="Auto" Height="Auto">
            <StatusBar Height="20" DockPanel.Dock="Bottom" Name="statusBar">
                    <StatusBarItem>
                        <TextBlock x:Name="MessageTextBlock"></TextBlock>
                    </StatusBarItem>
            </StatusBar>
            <TabControl Height="Auto" DockPanel.Dock="Top" Name="tabControlMessages">
            <TabItem Header="Message" IsSelected="True" >
                    <RichTextBox Name="richTextBox1" Style="{StaticResource FontStyle}" VerticalScrollBarVisibility="Auto" IsReadOnly="True" IsDocumentEnabled="True" Background="#FFEEF5FD">
                    <RichTextBox.Resources>
                        <Style TargetType="{x:Type Paragraph}">
                            <Setter Property="Margin" Value="0"/>
                        </Style>
                    </RichTextBox.Resources>
                    <RichTextBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Clear content" Name="MenuItemClear" Click="MenuItemClear_Click" />
                        <MenuItem  Header="Save to file" Name="MenuItemFile" Click="MenuItemFile_Click" />
                        <MenuItem Header="Copy to clipboard" Name="MenuItemCopy" Click="MenuItemCopy_Click" />
                    </ContextMenu>
                    </RichTextBox.ContextMenu>
                </RichTextBox>
             </TabItem>
            <TabItem Header="Concepts">
                    <DataGrid Name="dgConcepts"/>
            </TabItem>
            <TabItem Header="Validation Messages" Name="tabItemWebBrowser">
                <WebBrowser Name="webBrowserMsg" />
            </TabItem>
            <TabItem Header="Graph Diagram" Name="tabItemGraphDiagram">
                <WebBrowser Name="webBrowserGraph"/>
            </TabItem>           
            </TabControl>
        </DockPanel>
    </Grid>
</Window>
